package com.csdj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csdj.mapper.SyEmpMapper;
import com.csdj.pojo.BeComment;
import com.csdj.pojo.SyEmp;
import com.csdj.service.BeCommentService;
import com.csdj.mapper.BeCommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 叶涵
* @description 针对表【be_comment】的数据库操作Service实现
* @createDate 2023-08-24 15:13:39
*/
@Service
public class BeCommentServiceImpl extends ServiceImpl<BeCommentMapper, BeComment>
    implements BeCommentService{
    @Autowired
    private BeCommentMapper commentMapper;
    @Autowired
    private SyEmpMapper syEmpMapper;
    @Override
    public List<BeComment> getByNo(String orderNo) {
        LambdaQueryWrapper<BeComment> l=new LambdaQueryWrapper<>();
        l.eq(BeComment::getOrderNo,orderNo);
        List<BeComment> list = commentMapper.selectList(l);
        for (int i = 0; i < list.size(); i++) {
            list.get(i).setSyEmp(syEmpMapper.selectById(list.get(i).getEmpID()));
        }
        return list;
    }
}




